<template>
  <div class="home">
    <h1>home--骨架屏</h1>
    <!-- 中间logo -->
    <div class="image"></div>
    <div class="title"></div>
    <div class="btns">
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
    </div>
    <div class="footer">
      <div class="btn"></div>
      <div class="btn"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Skeleton',
  components: {},
  data() {
    return {
      items: [],
    };
  },

  mounted() {},
  methods: {},
};
</script>

<style scoped>
body,
html {
  margin: 0;
  padding: 0;
}
.home {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home .image {
  position: absolute;
  top: 35%;
  left: 25%;
  width: 200px;
  height: 200px;
  background-color: #ededed;
  background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(255, 255, 255, 0) 60%
    )
    #ededed;
  background-size: 200% 100%;
  background-position-x: 180%;
  animation: 1s loading ease-in-out infinite;
}
.home .title {
  position: absolute;
  top: 65%;
  left: 35%;
  margin-top: 4px;
  width: 112px;
  height: 23px;
  background-color: #ededed;
  background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(255, 255, 255, 0) 60%
    )
    #ededed;
  background-size: 200% 100%;
  background-position-x: 180%;
  animation: 1s loading ease-in-out infinite;
}
.home .btns {
  position: absolute;
  top: 70%;
  left: 2%;
  display: flex;
  flex-direction: row;
  margin-top: 4px;
}
.home .btns .item {
  width: 88px;
  height: 44px;
  background-color: #ededed;
  background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(255, 255, 255, 0) 60%
    )
    #ededed;
  background-size: 200% 100%;
  background-position-x: 180%;
  animation: 1s loading ease-in-out infinite;
}

.home .footer {
  width: 100vw;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 50px;
  border: 1px solid #ededed;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}
.home .footer .btn {
  width: 40px;
  height: 40px;
  background-color: #ededed;
  background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(255, 255, 255, 0) 60%
    )
    #ededed;
  background-size: 200% 100%;
  background-position-x: 180%;
  animation: 1s loading ease-in-out infinite;
}
@keyframes loading {
  to {
    background-position-x: -20%;
  }
}
</style>
